<template>
  <section @click="clickCurrent('current')" @mousedown="clickCurrent('dragging')">
    <div :class="['custorm--modelbox', 'graphicnotice-show', (custormCurrent == custormIndex)?'drag active':'drag']">
      <div v-if="custormItemData.params.isshow == '2'" class="noshow" v-bind:style="{'background-image':`url(${getPath('noshow.png')})`}"></div>
      <div style="overflow: hidden;" :style="{'padding':custormItemData.style.margincol+'px '+custormItemData.style.marginrow+'px'}">
        <div class="es-notice style1 flex-row flex-align-c" v-if="custormItemData.style.display==1" :style="{'background':custormItemData.style.bgcolor,'color':custormItemData.style.textcolor}">
          <img :src="getPath(custormItemData.params.thumb.file_path)" alt="">
          <span class="line-hide scale-grow">{{custormItemData.params.text}}</span>
        </div>
        <div style="overflow: hidden;background:#fafafa;">
          <div class="es-notice ellipsis style2 line-hide" v-if="custormItemData.style.display==2" :style="{'margin':custormItemData.style.margincol+'px '+custormItemData.style.marginrow+'px'}">
            <span>公告</span>{{custormItemData.params.text}}
          </div>
        </div>
      </div>
      <div class="btn-edit-del" @click="delCurrent"><span class="btn-del iconfont icon icon-close"></span></div>
    </div>
  </section>
</template>

<script>
import defaultConfig from './utils/showConfig'
export default {
  mixins: [defaultConfig.mixins],
  props: {
    defaultConfig: {
      type: Object,
      default: function() {
        return defaultConfig
      }
    }
  },
  methods: {

  }
}
</script>

<style lang="scss" scoped>
.custorm--modelbox.graphicnotice-show {
  .es-notice.style1 {
    background: #f2f2f2;
  }

  .line-hide,
  .two-line-hide {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .line-hide {
    white-space: nowrap;
  }

  .es-notice {
    border-radius: 4px;
    height: 36px;
    line-height: 40px;
  }

  .es-notice.style1 img {
    height: 18px;
    width: 18px;
    display: inline-block !important;
    margin-right: 6px;
    vertical-align: middle;
  }

  .es-notice.style2 {
    box-shadow: 4px 1px 20px #f2f2f2;
    background: #fff;
  }

  .es-notice.style2 span {
    background: #ffe1e1;
    color: #ff4f4f;
    border-radius: 9px;
    display: inline-block;
    width: 32px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    margin-right: 6px;
  }
}
</style>
